CREATE TABLE `SRTrade`.`MsgSRParentOrder` (
`parentNumber` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'SPDR order number',
`sysEnvironment` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None' COMMENT 'original (source) sys environment [Stable, Current, etc]',
`runStatus` ENUM('None','Prod','Beta','UAT','SysTest') NOT NULL DEFAULT 'None' COMMENT 'original (source) run status [Prod,Beta]',
`spdrActionType` ENUM('Add','AddReplace','Replace','Cancel','Modify') NOT NULL DEFAULT 'Add',
`parentShape` ENUM('None','Single','Cross','MLeg','MLegCross') NOT NULL DEFAULT 'None',
`clientSeqNumIn` INT NOT NULL DEFAULT 0 COMMENT 'inbound client seq number (FIX orders only)',
`altOrderId` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'alternate order ID (usually clOrdId from client)',
`altPrevOrderId` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'alternate prev order ID (usually origClOrdId from client during cxl/replace)',
`altAutoHedgeId` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'alternate order ID for child autohedge orders (if any)',
`altAccnt` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'alternate (client assigned) "long" account string (optional) [used to map between client and SR account strings]',
`altUserName` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'alternate (client assigned) user name (optional) [used to map between client and SR account strings]',
`srcRoutingCode` TINYTEXT NOT NULL DEFAULT '' COMMENT 'inbound FIX routing code or SRSE/tool server appID (if any)',
`packageId` BIGINT NOT NULL DEFAULT 0 COMMENT 'references spread orderNumber, if a legged spread order or auto-hedge order',
`secKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'Composite Security Key',
`secKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'Composite Security Key',
`secKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'Composite Security Key',
`secKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Composite Security Key',
`secKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Composite Security Key',
`secKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Composite Security Key',
`secKey_xx` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Composite Security Key',
`secKey_cp` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call' COMMENT 'Composite Security Key',
`secType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None' COMMENT 'Security Type [Stock, Future, Option]',
`securityDesc` TINYTEXT NOT NULL DEFAULT '' COMMENT 'additional security description',
`accnt` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR trading account',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`spdrSource` ENUM('None','SpdrTicket','SpdrSingle','SRSE','FIX','HedgeTool','TradeHedge','OpenHedge','AutoHedge','Orphan','RiskManager','OrderManager','ManagedOrder','RFQRespSrvr','Legger','SRSEDrop','FixDrop','TicketDrop','SysTest','RFRResponse','AllocOmni','AllocClient','CertGateway','MLegResponse','LeggerX','DropManager','AutoHedgeSrvr','AuctionStrategySrvr','AllocBlockFace','AllocBlockCust','IceChatGateway','EXS2SRC','MLinkResponse','AutoResponderVD','AutoResponderRC','AutoResponderSN','AutoResponderBX','MLink') NOT NULL DEFAULT 'None',
`groupingCode` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'unique broker code;broker.pkey = (key + accnt + spdrSource + groupingCode)',
`execBrkrCode` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'overrides the default executing broker for this parent order',
`externExDest` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'routing code for orders directed to an external order router (default = null); must match an exDest associated with a RouteDefinition',
`externParams` TINYTEXT NOT NULL DEFAULT '' COMMENT 'external algo names/parameters (usually just an algo name)',
`strategy` VARCHAR(36) NOT NULL DEFAULT '' COMMENT 'client-supplied strategy string;visible on SpiderRock GUI tools and other order reports.',
`userName` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'name of the user entering the order',
`userSource` ENUM('None','SpdrTicket','SpdrSingle','SRSE','FIX','HedgeTool','TradeHedge','OpenHedge','AutoHedge','Orphan','RiskManager','OrderManager','ManagedOrder','RFQRespSrvr','Legger','SRSEDrop','FixDrop','TicketDrop','SysTest','RFRResponse','AllocOmni','AllocClient','CertGateway','MLegResponse','LeggerX','DropManager','AutoHedgeSrvr','AuctionStrategySrvr','AllocBlockFace','AllocBlockCust','IceChatGateway','EXS2SRC','MLinkResponse','AutoResponderVD','AutoResponderRC','AutoResponderSN','AutoResponderBX','MLink') NOT NULL DEFAULT 'None' COMMENT 'SpdrSource of this order (assumed to be the same as spdrSource if None)',
`orderDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'order entry time (from client;if any)',
`orderSide` ENUM('None','Buy','Sell') NOT NULL DEFAULT 'None',
`orderSize` INT NOT NULL DEFAULT 0 COMMENT 'maximum fill size (contracts)',
`orderActiveSize` INT NOT NULL DEFAULT 0 COMMENT 'total activated size (total size released for execution) (-1 = all available size)',
`curCumFillQuantity` INT NOT NULL DEFAULT 0 COMMENT 'set order size = orderSize - Max(0, curCumFillQty - ee.cumFillQty) (used to ensure integrity of submitted cxl/replace orders)',
`addCumFillQuantity` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'If Yes then OrderSize is calculated @ order arrival as requested OrderSize + existing ''CumFillQuantity''.',
`maxExposureSize` INT NOT NULL DEFAULT 0 COMMENT 'maximum simultaneous cumulative child order public size exposure (-1 = orderActiveSize) [order can overfill if > orderActiveSize and numMakeExchanges > 1]',
`numMakeExchanges` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of exchanges (1 - 4) on which to publish public making orders. Effective number might be less than requested number if sufficient exchanges are not available.',
`publicSize` ENUM('None','Randomize','MktSize','FullSize','MktSizeA','MktSizeB','MktSizeC','FullSizeR','Max25Pct','Max50Pct','Max75Pct','NoSize') NOT NULL DEFAULT 'None' COMMENT 'public order size handling: None=algo default; Randomize=randomize public size; MktSize=expose typical market size; FullSize=expose entire order size where possible; FullSizeR=randomize full size',
`canOverlapCxlRepl` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'can execution engines overlap cancel/replace operations [order can overfill if YES] (at most one active overlapping cxl/replace operation for each parent order)',
`progressRule` ENUM('None','Twap','Vwap','TwapReset','VwapReset','FastReset','SlowReset','TwapAlpha','VwapAlpha','TwapAlphaC','VwapAlphaC','AutoComplete','AllowImmediate','Manual','SpdrPulse','IOC') NOT NULL DEFAULT 'None' COMMENT 'Immediate = all size immediately available; TWAP = work from arrival to expiration; VWAP = work order not faster than participation rate',
`blockVisibility` ENUM('None','Neither','Side','SidePrice') NOT NULL DEFAULT 'None' COMMENT 'for BlockAuction orders, visibility (to responders) is neither, side only, or side + price',
`progressSliceCnt` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of slices to use (default = 4 or 8) [max 20]',
`progressExposeTime` INT NOT NULL DEFAULT 0 COMMENT 'minimum time (secs) to expose order (0 = no minimum; used to guarantee that the order is exposed at mid-market for some time before actively taking)',
`vwapParticipation` FLOAT NOT NULL DEFAULT 0 COMMENT 'target vwap participation rate (target % of trade activity)',
`minMktOnClosePct` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Minimum pct [0 - 100] of order reserved for the on-close (MOC) auction',
`triggerType` ENUM('None','PrintPrc','PrintVol','SurfVol','PrtSurfVol') NOT NULL DEFAULT 'None' COMMENT 'type of trigger (PrintVol/SurfVol only for options) [print = print or actionable quote]',
`triggerLevel` FLOAT NOT NULL DEFAULT 0 COMMENT 'stop/trigger level for parent order to go active (can be either a price or vol)',
`auctionResponder` ENUM('None','Any') NOT NULL DEFAULT 'None' COMMENT 'if set, parent order can be an auction responder',
`maxMakeExchFee` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum making exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]',
`maxTakeExchFee` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum taking exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]',
`incTakeExchFee` ENUM('None','ExclFee','IncFee') NOT NULL DEFAULT 'None' COMMENT 'include exchange fee in probability and surface based take limit calculations',
`incMakeExchFee` ENUM('None','ExclFee','IncFee') NOT NULL DEFAULT 'None' COMMENT 'include exchange fee in probability and surface based make limit calculations',
`makeExchRule` ENUM('None','MaxPart','FeeOptimal','ImprvOnly','FeeStrict','RoundRobin','ProRataOptim') NOT NULL DEFAULT 'None' COMMENT 'ActiveMaker exch preference: ''MaxPart'' = max participation; ''FeeOrder'' = minimize fees [max rebates]; ''ImprvOnly'' will only make when improving NBBO; ''RoundRobin'' will rotate through exch list; ''ProRataOptim'' will post on pro-rata only.',
`cxlUPrcRange` ENUM('None','Yes','No','YesHalt','NoHalt') NOT NULL DEFAULT 'None' COMMENT 'cancel parent order if/when outside the uPrice range [ _Halt = also cancel if halted ]',
`minUBid` FLOAT NOT NULL DEFAULT 0 COMMENT '[optional]',
`maxUAsk` FLOAT NOT NULL DEFAULT 0 COMMENT '[optional] (< $0.01 = none)',
`minMaxType` ENUM('None','Prc','Pct') NOT NULL DEFAULT 'None' COMMENT 'if Prc minUBid/maxUAsk are expressed as prices; if Pct then they are expresses as pct change since parent order arrival',
`minOptionPx` FLOAT NOT NULL DEFAULT 0 COMMENT '[optional] option price floor for tied to stock orders',
`maxChildOrders` INT NOT NULL DEFAULT 0 COMMENT 'maximum number of child orders that can be generated by this parent order [order will terminate if/when this cap is reached;zero or neg = unlimited]',
`exchMask` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'eligible exchanges (0 = all)',
`spdrStageType` ENUM('None','ModifyAny','ModifyAlgo') NOT NULL DEFAULT 'None' COMMENT 'note: stageType != None implies both KeepAlive behavior and makes the order visible on tools',
`marketSession` ENUM('None','PreMkt','RegMkt','PostMkt','PreRegMkt','RegPostMkt','AllDay') NOT NULL DEFAULT 'None',
`startDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT '[optional] (parent order start time)',
`orderDuration` INT NOT NULL DEFAULT 0 COMMENT '[optional] (number of seconds)',
`activeDuration` INT NOT NULL DEFAULT 0,
`goodTillDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT '[optional] (default: 2099-01-01)',
`startType` ENUM('None','WaitTrigger','TriggerAll') NOT NULL DEFAULT 'None' COMMENT 'WaitTrigger associates this order with a triggerGroupId. The initial wave of child orders from the TriggerGroup will be send when a (final) parent order with startType=TriggerAll or when an external trigger signal is received.',
`triggerGroupId` BIGINT NOT NULL DEFAULT 0 COMMENT 'triggerGroupId is required if startType=WaitTrigger; note that child orders from all parent orders in the trigger group will be organized and released optimally when the triggerGroup is released',
`triggerTimestamp` BIGINT NOT NULL DEFAULT 0 COMMENT 'WaitTrigger trigger timestamp (nanoseconds since epoch)',
`parentOrderHandling` ENUM('None','ActiveTaker','PostOnly','DMA','MktOnOpn','MktOnCls','Facilitate','Matrix','Legger','Seeker','SeekerLegger','CrossResponse','AuctionResponse','MLegAuctionResp','RFQRequest','AwayAlgo','ExchPing','BlockAuction','BlockResponse','SweepTake','CobMaker','FaceOmni','TestParent') NOT NULL DEFAULT 'None',
`parentBalanceHandling` ENUM('None','PostWith','PostTurn','PostImprove','PostLimit','MaxIntern','PostWthF','PostImprvR','PostFlash','PostFlashW','PostPeg','PostFlashI') NOT NULL DEFAULT 'None',
`orderLimitType` ENUM('None','Market','MarketArrival','Prc','PrcDe','PrcDeX','PrcDeT','PrcDeP','PrcDeXT','PrcDeXP','Vol','VolX','PrcV','PrcVX','NoLimit','RelMid','RelJoin','RelCross','SmrtFast','SmrtNorm','RelTurn','PrcDeEm','VolEm','Aux','UPrcPct','PkgNeutral','RcPrem','SynthLimitMM','SynthLimitBW','SynthLimitWW') NOT NULL DEFAULT 'None',
`takeLimitClass` ENUM('Simple','Surface','Probability','SurfProb') NOT NULL DEFAULT 'Simple' COMMENT 'Simple = LimitPrice +/- offset, Surface = BEST(LimitPrice, SurfLimit), Probability = BEST(LimitPrice, ProbLimit), SurfProb = BEST(LimitPrice, SurfLimit, ProbLimit)',
`makeLimitClass` ENUM('Simple','Surface','Probability','SurfProb') NOT NULL DEFAULT 'Simple' COMMENT 'Simple = LimitPrice +/- offset, Surface = BEST(LimitPrice, SurfLimit), Probability = BEST(LimitPrice, ProbLimit), SurfProb = BEST(LimitPrice, SurfLimit, ProbLimit)',
`takeReachRule` ENUM('None','Delayed','Passive','WeakOnly','RespondOnly','FullSize','ISOSweep','AllOrNone','QtyOrMore','UpToQty','AtMost25','AtMost50','MinTakeFee') NOT NULL DEFAULT 'None' COMMENT 'None = size immediately available; Delayed = available after [1-3] seconds; Passive = available if contra side aggresses; WeakOnly = only take if available size < avgMarketSize; ISOSweep = Intermarket Sweep [requires WaitTrigger]',
`orderPrcLimit` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Applies if LimitType = Prc[]',
`orderRefUPrc` DOUBLE NOT NULL DEFAULT 0 COMMENT 'default=underlier.mid',
`orderRefDelta` FLOAT NOT NULL DEFAULT 0 COMMENT 'default=option.delta',
`orderRefGamma` FLOAT NOT NULL DEFAULT 0 COMMENT 'default=option.gamma',
`orderVolLimit` FLOAT NOT NULL DEFAULT 0 COMMENT 'Applies if LimitType = Vol[] [uses SR dividends and borrow rates]',
`rateOverride` FLOAT NOT NULL DEFAULT 0 COMMENT 'zero = ignore; > zero = override',
`sdivOverride` FLOAT NOT NULL DEFAULT 0,
`ddivOverride` TINYTEXT NOT NULL DEFAULT '' COMMENT 'discrete dividend string override ([yearsToExpiry,divYears:divAmount,divYears:divAmount, ...])',
`overrideCode` ENUM('None','SDivOnly','DDivOnly','Both') NOT NULL DEFAULT 'None',
`orderPrcOffset` DOUBLE NOT NULL DEFAULT 0 COMMENT 'default=0 [surface, relX and pegX limit offsets]',
`stateModel` ENUM('None','M1','M2','M3','M4') NOT NULL DEFAULT 'None',
`uStateModel` ENUM('None','M1','M2','M3','M4') NOT NULL DEFAULT 'None',
`takeAlphaType` ENUM('None','Static','Eagle','Hawk','Falcon','Relative') NOT NULL DEFAULT 'None' COMMENT 'Applies if takeLimitClass = Probability',
`makeAlphaType` ENUM('None','Static','Eagle','Hawk','Falcon','Relative') NOT NULL DEFAULT 'None' COMMENT 'Applies if makeLimitClass = Probability',
`takeAlphaFactor` FLOAT NOT NULL DEFAULT 0 COMMENT '[-2,+2] takeProbLimit = MAX(takeProbability, takeProbAvg + takeAlphaFactor * takeProbStd) [if AlphaType = Relative]',
`makeAlphaFactor` FLOAT NOT NULL DEFAULT 0 COMMENT '[-2,+2] makeProbLimit = MAX(makeProbability, makeProbAvg + makeAlphaFactor * makeProbStd) [if AlphaType = Relative]',
`takeProbability` FLOAT NOT NULL DEFAULT 0 COMMENT 'takeProbLimit = takeProbability [if AlphaType = Static]',
`makeProbability` FLOAT NOT NULL DEFAULT 0 COMMENT 'makeProbLimit = makeProbability [if AlphaType = Static]',
`takeSurfPrcOffset` DOUBLE NOT NULL DEFAULT 0 COMMENT 'default=0',
`takeSurfVolOffset` FLOAT NOT NULL DEFAULT 0 COMMENT 'default=0',
`takeSurfWidthOffset` FLOAT NOT NULL DEFAULT 0 COMMENT '[-1.x to +1.x] -1.0 = -0.5 * avgMktWidth, +1.0 = +0.5 * avgMktWidth',
`makeSurfPrcOffset` DOUBLE NOT NULL DEFAULT 0 COMMENT 'default=0',
`makeSurfVolOffset` FLOAT NOT NULL DEFAULT 0 COMMENT 'default=0',
`makeSurfWidthOffset` FLOAT NOT NULL DEFAULT 0 COMMENT '[-1.x to +1.x] -1.0 = -0.5 * avgMktWidth, +1.0 = +0.5 * avgMktWidth',
`orderRefEventMult` FLOAT NOT NULL DEFAULT 0 COMMENT 'expected underlier abs move (0.01 = 1%) @ orderRefEventDttm',
`orderRefEventDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'Date/time of the next event. Note that events are usually earnings but are not required to be.',
`autoHedge` ENUM('None','Static','AutoMid','AutoCrx','AutoTrn','SpdrAuto','Spdr10S','Spdr30S','Spdr90S','Spdr5M','Spdr30M','SpdrDay','SmartFast','SmartNorm','FastCrx','FastDark','SlowDark','AlphaVwap1pct','AlphaVwap2pct','AlphaVwap5pct','AlphaVwap25pct','Custom','AwayAlgo') NOT NULL DEFAULT 'None',
`hedgeInstrument` ENUM('None','Default','FrontMonth','Stock','Future') NOT NULL DEFAULT 'Default' COMMENT 'Default=actual underlier (EQT or FUT) [IndexOptions use ETF]; FrontMonth=actual underlier (EQT) or front month (FUT) [IndexOptions use FM Fut]; Stock=hedgeSecKey.TickerKey; Future=hedgeSecKey.ExpiryKey',
`hedgeSecKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeBetaRatio` FLOAT NOT NULL DEFAULT 0 COMMENT 'portion of executed $money to auto-hedge (can be 1.0 / Beta for beta hedging) [-4.0 to +4.0]',
`hedgeScope` ENUM('None','Accnt','RiskGroup') NOT NULL DEFAULT 'None' COMMENT 'hedge group scope [RiskGroup or Accnt]',
`hedgeSession` ENUM('None','PreMkt','RegMkt','PostMkt','PreRegMkt','RegPostMkt','AllDay') NOT NULL DEFAULT 'None' COMMENT 'market session for the autohedge order [defaults to pOrder.marketSession]',
`externHedgeExDest` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'external broker exDest (only used if orderHandling=Extern) # Should match FixRoutingTable.destination type (eg. #Nighthawk)',
`externHedgeParams` TINYTEXT NOT NULL DEFAULT '' COMMENT 'external algo names/parameters (usually just an algo name) # usually copied from the FixRoutingTable.externParams',
`firmType` ENUM('None','Customer','Firm','MarketMaker','ProCustomer','BrokerDealer','AwayMM','FirmJBO','BrkrDlrCust') NOT NULL DEFAULT 'None' COMMENT 'used to override firmType in account config',
`orderCapacity` ENUM('None','Agency','Principal','Individual','Proprietary','AgentOtherMember','RisklessPrincipal') NOT NULL DEFAULT 'None',
`positionType` ENUM('None','Opening','Closing','Auto') NOT NULL DEFAULT 'None',
`ssaleFlag` ENUM('None','Long','Short','Exempt','Auto','Open','Close','Cover','NA') NOT NULL DEFAULT 'None' COMMENT 'used to determine stock auto-hedge flags',
`locateFirm` VARCHAR(6) NOT NULL DEFAULT '' COMMENT 'firm granting the locate (also locate firm used on street FIX orders) (required if selling short and no auto-locate is available)',
`locatePool` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'locate pool @ firm granting the locate',
`noCrossGroup` VARCHAR(16) NOT NULL DEFAULT '',
`exchTraderId` VARCHAR(16) NOT NULL DEFAULT '',
`largeTraderId` VARCHAR(16) NOT NULL DEFAULT '',
`tradingLocation` VARCHAR(16) NOT NULL DEFAULT '',
`leadSide` ENUM('None','Buy','Sell') NOT NULL DEFAULT 'None' COMMENT 'for legged orders, which side to lead with. (optional, None ok)',
`maxCompletionSlippage` DOUBLE NOT NULL DEFAULT 0 COMMENT 'maximum price slippage to complete an open basket',
`orderRefPremium` FLOAT NOT NULL DEFAULT 0 COMMENT 'reference premium (mleg orders only)',
`noticeNumber` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'required when parentOrderHandling = BlockResponse',
`theoVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'client supplied theoretical volatility (used for markup only)',
`clArriveMark` FLOAT NOT NULL DEFAULT 0 COMMENT 'client specified arrival mark (passed through to ParentExecution; markup only)',
`riskGroupId` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'all orders with the same riskGroupId share a common set of risk counters;.Grp. risk limits apply to these shared counters',
`reqAuxRiskGroupCtrl` ENUM('None','Yes','No') NOT NULL DEFAULT 'None',
`refRMetric1Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric2Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric3Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric4Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric5Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric6Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`refRMetric7Src` ENUM('None','User','Vega','WVega','WTVega','TVega','Theta','Gamma','DGamma','DDeltaIvS','BDDelta','OptDDelta','Premium','Notional') NOT NULL DEFAULT 'None',
`orderRefRMetric1` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric1 value (used in RiskGroupID risk controls) [netRMetric1 = sum(fillQty * orderRefRMetric1 * underlierPerCn)]',
`orderRefRMetric2` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric2 value (used in RiskGroupID risk controls) [netRMetric2 = sum(fillQty * orderRefRMetric2 * underlierPerCn)]',
`orderRefRMetric3` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric3 value (used in RiskGroupID risk controls) [netRMetric3 = sum(fillQty * orderRefRMetric3 * underlierPerCn)]',
`orderRefRMetric4` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric4 value (used in RiskGroupID risk controls) [netRMetric4 = sum(fillQty * orderRefRMetric4 * underlierPerCn)]',
`orderRefRMetric5` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric5 value (used in RiskGroupID risk controls) [netRMetric5 = sum(fillQty * orderRefRMetric5 * underlierPerCn)]',
`orderRefRMetric6` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric6 value (used in ExpDay risk controls) [netRMetric6 = sum(fillQty * orderRefRMetric6 * underlierPerCn)]',
`orderRefRMetric7` FLOAT NOT NULL DEFAULT 0 COMMENT 'user supplied RMetric7 value (used in SymDay risk controls) [netRMetric7 = sum(fillQty * orderRefRMetric7 * underlierPerCn)]',
`expDayWtVegaOffset` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day wtVega offset (target)',
`maxExpDayWtVegaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max accnt+expiration day (time weighted) vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)',
`maxExpDayWtVegaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max accnt+expiration day (time weighted) vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)',
`maxExpDayRMetric6Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+expiration day rMetric6 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxExpDayRMetric6Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+expiration day rMetric6 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`symDayDDeltaOffset` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day $delta offset (target)',
`maxSymDayDDeltaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day $delta long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)',
`maxSymDayDDeltaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day $delta short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)',
`symDayVegaOffset` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day vega offset (target)',
`maxSymDayVegaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)',
`maxSymDayVegaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)',
`symDayWtVegaOffset` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day wtVega offset (target)',
`maxSymDayWtVegaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day (time weighted) vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)',
`maxSymDayWtVegaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day (time weighted) vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)',
`maxSymDayRMetric7Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day rMetric7 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxSymDayRMetric7Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol day rMetric7 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayDDeltaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day $delta long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayDDeltaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day $delta short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayVegaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day vega long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayVegaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day vega short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayVegaAbs` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day vega abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)',
`grpDayVegaRatio` FLOAT NOT NULL DEFAULT 1.0 COMMENT 'target bot / sld ratio (eg ratio=2.0 means that neutral is bot vega = 2x sld vega)',
`maxGrpDayContractsLn` INT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day opt contracts long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayContractsSh` INT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day opt contracts short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayContractsAbs` INT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day opt contracts abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)',
`maxGrpDayRMetric1Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric1 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayRMetric1Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric1 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayRMetric1Abs` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric1 abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)',
`grpDayRMetric1Ratio` FLOAT NOT NULL DEFAULT 1.0 COMMENT 'target bot / sld ratio (eg ratio=0.5 means that neutral is bot rMetric1 = 0.5x sld rMetric1)',
`maxGrpDayRMetric2Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric2 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayRMetric2Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric2 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayRMetric3Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric3 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayRMetric3Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric3 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayRMetric4Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric4 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayRMetric4Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric4 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`maxGrpDayRMetric5Ln` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric5 long (positive number;-1=no limit);risk limit = max limit - current net counter',
`maxGrpDayRMetric5Sh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+riskGroup day rMetric5 short (positive number;-1=no limit);risk limit = max limit + current net counter',
`symEmaCxlDDeltaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol 60s EMA $delta long (positive number; <= 0 is no limit) [will immediately cxl all option orders in a symbol if any order in the symbol breaches]',
`symEmaCxlDDeltaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol 60s EMA $delta short (positive number; <= 0 is no limit)',
`symEmaCxlWtVegaLn` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol 60s EMA wtVega long (positive number; <= 0 is no limit) [will immediately cxl all option orders in a symbol if any order in the symbol breaches]',
`symEmaCxlWtVegaSh` FLOAT NOT NULL DEFAULT -1 COMMENT 'max acct+symbol 60s EMA wtVega short (positive number; <= 0 is no limit)',
`lastFillDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`userData1` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`userData2` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`childData` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to down stream child orders',
`srcTimestamp` BIGINT NOT NULL DEFAULT 0,
`sgwTimestamp` BIGINT NOT NULL DEFAULT 0,
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`includeSRNetwork` ENUM('None','Include','Exclude','Disclose') NOT NULL DEFAULT 'None',
`DirectedCounterPartyList` JSON NOT NULL DEFAULT JSON_ARRAY() CHECK(JSON_VALID(DirectedCounterPartyList)),
`OrderLegsList` JSON NOT NULL DEFAULT JSON_ARRAY() CHECK(JSON_VALID(OrderLegsList)),
CONSTRAINT nonnegative_parentNumber CHECK(ASCII(parentNumber) < 56),
CONSTRAINT nonnegative_groupingCode CHECK(ASCII(groupingCode) < 56),
CONSTRAINT nonnegative_noticeNumber CHECK(ASCII(noticeNumber) < 56),
CONSTRAINT nonnegative_riskGroupId CHECK(ASCII(riskGroupId) < 56),
PRIMARY KEY USING HASH (`parentNumber`),
KEY `AccntCodeIndex` (`accnt`) USING HASH,
KEY `SecKeyIndex` (`secKey_at`,`secKey_ts`,`secKey_tk`,`secKey_yr`,`secKey_mn`,`secKey_dy`,`secKey_xx`,`secKey_cp`) USING HASH
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='SpdrParentOrder records are visible in SRSE immediately after receipt. Parent orders received via FIX, SRSE or SpiderRock GUI tools, or 3rd party vendor systems are all visible in this table.\nParent orders can be for stocks, futures, options or spreads. And they can be one-sided (agency) or two-sided (facilitation) orders. Parent order records should be immutable and not update.\nSpdrParentOrder records are published to the SpiderRock elatic cluster on arrival.';